﻿using System.Windows;
using System.Windows.Controls;

namespace Tester.Models
{
    public class WFPComposer
    {
        public void ComposeUserTest(StackPanel targetStackPanel)
        {
        }

        public UIElementCollection ComposeUserQuestion(UIElement parentUIElement, Question question)
        {
            var collection = new UIElementCollection(parentUIElement, null);
            var wrapPanel = new WrapPanel();
            wrapPanel.Children.Add(new Label {Content = question.Text});

            var stackPanel = new StackPanel();

            foreach (string answer in question.Answers)
                stackPanel.Children.Add(new RadioButton {Content = answer, Tag = question});

            wrapPanel.Children.Add(stackPanel);
            collection.Add(wrapPanel);

            return collection;
        }
    }
}